﻿using ExpressesClass.Model;
using OFFICE_Helper.Util;
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace OFFICE_Helper.Forms
{
    public partial class TraceForm : Form
    {
        #region 变量
        private Kddh kddh;
        #endregion

        #region 方法
        public TraceForm(Kddh kddh)
        {
            InitializeComponent();
            this.kddh = kddh;
        }
        public void InitCtrl()
        {
            dgv_data.DataSource = new List<TraceLog>();
            dgv_data.Columns["acceptTime"].Width = 150;
            dgv_data.Columns["acceptAddress"].Width = 100;
            dgv_data.Columns["scanType"].Width = 100;
            dgv_data.Columns["remark"].Width = 400;
            dgv_data.Columns["acceptTime"].HeaderText = "到达时间";
            dgv_data.Columns["acceptAddress"].HeaderText = "到达地点";
            dgv_data.Columns["scanType"].HeaderText = "扫描类型";
            dgv_data.Columns["remark"].HeaderText = "备注";
        }
        public void Init()
        {
            dgv_data.DataSource = ExpressUtil.GetExpressMsg(kddh);
        }
        #endregion

        #region 事件
        private void TraceForm_Load(object sender, EventArgs e)
        {
            InitCtrl();
            Init();
        }
        #endregion
    }
}
